package cn.lele.reggie.mapper;

import cn.lele.reggie.entity.Orders;
import cn.lele.reggie.to.AmountAndDateTo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper extends BaseMapper<Orders> {

    Double sumByMap(Map map);

    /**
     * desc SELECT SUM(amount) 总金额,Date(order_time) 日期
     * FROM orders
     * WHERE order_time<'2024-12-16'
     * AND order_time>'2024-06-05'
     * group BY Date(order_time)
     * ORDER BY DATE(order_time)
     * @return
     */
    List<AmountAndDateTo> sumByTime(String orderTime, int status);
}
